package main;

/**
 * Created by twer on 3/3/14.
 */
public class TriangleExercises {

    public void OutEasiest(){
        System.out.println("Easiest Exercises:");
        System.out.println("*");
    }

    public void OutHorizontalLine(int lineLength){
        System.out.println("Horizontal line:");
        System.out.println(getHorizontalLine(lineLength));
    }

    private String getHorizontalLine(int lineLength) {
        String horizontalLine = "";
        while(lineLength>0){
            horizontalLine += "*";
            lineLength --;
        }
        return horizontalLine;
    }

    public void OutVerticalLine(int lineHeight){
        String verticalLine = "";
        while(lineHeight>0){
            verticalLine += "*\n";
            lineHeight --;
        }
        System.out.println("Vertical line:");
        System.out.print(verticalLine);
    }

    public void OutRightTriangle(int sideLength){
        String rightTriangle = "";
        for(int i=1; i<=sideLength; i++){
            rightTriangle += getHorizontalLine(i) + "\n";
        }
        System.out.println("Right Triangle");
        System.out.print(rightTriangle);
    }
}
